<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <link rel="stylesheet" type="text/css" th:href="@{/ajax/libs/qxEasyUI/themes/default/easyui.css}">
    <th:block th:include="include :: header('新增来电记录')"/>
    <link th:href="@{/ajax/libs/bootstrap-tagsinput/tagsinput.css}" rel="stylesheet">
    <link th:href="@{/ajax/libs/jQuery-ui/jquery-ui.css}" rel="stylesheet">
    <link rel="stylesheet" type="text/css" th:href="@{/ajax/libs/qxEasyUI/themes/default/easyui.css}">
</head>
<style>
    #errText{

    }
</style>
<body style="background-color: #F4F6FA">
<div class="main-content " style="margin: 0;padding: 0">

    <form id="form-user-add" class="form-horizontal" th:object="${telGetDeal}" style="background-color: #F4F6FA">
        <input name="pkId" id="pkId" type="hidden" value="">
        <input name="liftWorkNo" th:field="*{liftWorkNo}" type="hidden">
        <input name="liftWorker" th:field="*{liftWorker}" type="hidden">
        <input name="liftTelNo" th:field="*{liftTelNo}" type="hidden">
        <input name="callId" value="-1" type="hidden">
        <input name="tapeId" value="-1" type="hidden">
        <input name="fromTime" id="tmFrom" type="hidden" th:field="*{fromTime}">
        <input name="fmCerName" type="hidden" value="-1">
        <input name="fmCerNo" type="hidden" value="">
        <input name="fmEmail" type="hidden" value="">
        <input name="flagInt" type="hidden" value="0"/>
        <input name="flagString" type="hidden" value=""/>
        <input name="spareInt" type="hidden" value="0"/>
        <input name="spareString" type="hidden" value=""/>
        <input name="fkstring" type="hidden" value=""/>

        <div class="col-sm-12" style="display: flex">
            <!--     左       -->
            <div class="col-sm-7 entering-page">
                <!--    历史来电    -->
                <div class="col-sm-12 entering-top">
                    <div>历史来电数:<strong>[[${history}]]/[[${noLike}]]</strong></div>
                    <!--                    <div>不满意:<strong>[[${noLike}]]</strong></div>-->
                    <div>常涉问题:<strong>[[${problem}]]</strong></div>
                </div>
                <!--事发地址-->
                <div class="col-sm-12 entering-mt">
                    <div class="form-group">
                        <label class="col-sm-2 control-label entering-pd">事发地址：</label>
                        <div class="col-sm-7">
                            <input name="fmAddress" id="fmAddress" placeholder="请输入"
                                   class="form-control scene theAddress" type="text">
                        </div>
<!--                        <div class="col-sm-2">-->
<!--                            <input type="hidden" id="sensitiveId" name="sensitiveId" value=""/>-->
<!--                            <button type="button" class="btn btn-sm btn-primary"-->
<!--                                    style="margin-top: 3px;color: #206ef7;background-color: white"-->
<!--                                    onclick="sensitivity('save')">敏感信息-->
<!--                            </button>-->
<!--                        </div>-->
                        <div class="col-sm-1">
                            <button type="button" class="btn btn-sm btn-primary"
                                    style="margin: 3px 0px 0px -25px;color: #206ef7;background-color: white"
                                    onclick="sensitivity('save')">敏感信息
                            </button>
                        </div>
                        <div class="col-sm-1">
                            <button type="button" class="btn btn-sm btn-primary"
                                    style="margin: 3px 0px 0px -5px;color: #206ef7;background-color: white"
                                    onclick="aiAnswering()">智能问答
                            </button>
                        </div>
                    </div>
                </div>
                <!--来电类容-->
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-xs-2 control-label is-required entering-pd">来电内容：</label>
                        <div class="col-xs-10">
<!--                            <textarea name="fmContent" id="fmContent"  class="form-control phoneRemark"-->
<!--                                      rows="3" style="height: 120px;resize: vertical;"-->
<!--                                      oninput="checkError()"-->
<!--                                      onblur="aboutContent()"-->
<!--                                      required></textarea>-->
                            <textarea name="fmContent" id="fmContent"  class="form-control phoneRemark"
                                      rows="3" style="height: 120px;resize: vertical;"
                                      required></textarea>
                            <button type="button" class="btn btn-sm btn-primary"
                                    style="position: absolute;right: 15px;margin-top: 5px" onclick="identification()">
                                智能预载
                            </button>

                        </div>
                    </div>
                </div>
                <!--来电人名等，关键词等，分两个部分-->
                <!--来电人名等-->
                <div class="col-sm-12" style="margin-top: 30px">
                    <div class="col-sm-6">
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-sm-4 control-label is-required entering-pd">地区：</label>
                                <div class="col-sm-8">
                                    <select name="fmAreaNo" id="fmAreaNo" required
                                            th:with="area=${@commonServiceImpl.findArea()}"
                                            onchange="dropChgSendTextOnly(this,'fmAreaName');"
                                            class="form-control formSelect">
                                        <option value="">--请选择--</option>
                                        <th:block th:each="item : ${area}">
                                            <option th:text="${item['CSText']}" th:value="${item['CSValue']}"></option>
                                        </th:block>
                                    </select>
                                    <input type="hidden" name="fmAreaName" id="fmAreaName" th:value="*{fmAreaName}"/>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-sm-4 control-label is-required entering-pd">来电人名：</label>
                                <div class="col-sm-8">
                                    <input id="fromName" name="fromName" value="匿名" placeholder="请输入"
                                           class="form-control phoneName" type="text"
                                           maxlength="5" required="">
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-sm-4 control-label entering-pd is-required"> 被叫号码：</label>
                                <div class="col-sm-8">
                                    <input type="text" id="fromTelC" class="form-control relationPhone"
                                           name="fromTelC"/>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-sm-4 control-label entering-pd is-required">来电号码：</label>
                                <div class="col-sm-8">
                                    <input name="fromTelA" id="fromTelA" placeholder="请输入"
                                           class="form-control relationPhone"
                                           type="text" value="" required>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-sm-4 control-label is-required entering-pd">来电类别：</label>
                                <div class="col-sm-8">
                                    <select name="dfmClaNo" id="dfmClaNo" required
                                            th:with="telTypes=${@commonServiceImpl.findTelType()}"
                                            onchange="dropChgSendTextOnly(this,'dfmClaName');"
                                            class="form-control formSelect">
                                        <option value="">--请选择--</option>
                                        <th:block th:each="item : ${telTypes}">
                                            <option th:text="${item['CSText']}" th:value="${item['CSValue']}"></option>
                                        </th:block>
                                    </select>
                                    <input type="hidden" name="dfmClaName" id="dfmClaName" th:value="*{dfmClaName}"/>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-sm-4 control-label is-required entering-pd is-required">内容类别：</label>
                                <div class="col-sm-8">
                                    <input id="qxCT" style="width:188px;height:31px;">
                                    <input id="txtDcntAcode" name="dcntAcode" type="hidden" value=""/>
                                    <input id="txtDCntAName" name="dcntAname" type="hidden" value=""/>
                                </div>
                            </div>
                            <div class="form-group" id="contentType" hidden>
                                <div class="col-xs-12 select-table table-striped">
                                    <table id="bootstrap-table"></table>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-sm-4 control-label entering-pd">流水号：</label>
                                <div class="col-sm-8">
                                    <input name="wsCode" class="form-control" type="text" id="wsCode" readonly
                                           UNSELECTABLE="on"><span>(自动生成)</span>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-sm-4 control-label entering-pd">被诉主体：</label>
                                <div class="col-sm-6">
                                    <input name="accSubject" placeholder="请输入" class="form-control" type="text"
                                           id="subject">
                                </div>
                                <div class="col-sm-2">
                                    <button type="button" class="btn btn-sm btn-primary"
                                            style="margin: 3px 0 0 -20px;color: #206ef7;background-color: white"
                                            onclick="_accSubjectDraw()">被诉主体画像
                                    </button>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-xs-4 control-label entering-pd">交办意见：</label>
                                <div class="col-xs-8">
                                    <select id="xDealDescSelect" onchange="dropChgSendTextOnly(this,'xdealDesc');"
                                            th:with="district=${@commonServiceImpl.findOpinion()}"
                                            class="form-control formSelect">
                                        <option value="">--请选择--</option>
                                        <option th:each="item : ${district}" th:text="${item['CSText']}"
                                                th:value="${item['CSValue']}"></option>
                                    </select>


                                </div>
                            </div>
                            <div class="form-group">
                                <!--                                <label class="col-xs-4 control-label entering-pd">意见详情：</label>-->
                                <div class="col-xs-12">
                                <textarea name="xdealDesc" style="resize: vertical;" id="xdealDesc" maxlength="3500"
                                          class="form-control opinion"
                                          rows="5"></textarea>
                                    <span>还可以输入<i class="opinionI">3500</i>个文字</span>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="col-sm-6">
                        <!--bootstrap关键词等-->
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-xs-4 control-label">热词标签：</label>
                                <div class="col-xs-8">
                                    <input class="antistop" name="keyWord" id="keyWord" type="text" value=""
                                           data-role="tagsinput">
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-xs-4 control-label">性别：</label>
                                <div class="col-xs-8">
                                    <label class="check-box">
                                        <input name="fromSex" id="fromSex1" value="1" type="radio" checked>男
                                    </label>
                                    <label class="check-box">
                                        <input name="fromSex" id="fromSex0" value="0" type="radio">女
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-xs-4 control-label">屏蔽号码：</label>
                                <div class="col-xs-8">
                                    <label class="check-box">
                                        <input name="hideTel" id="hideTel5" value="5" type="radio">是
                                    </label>
                                    <label class="check-box">
                                        <input name="hideTel" id="hideTel0" value="0" type="radio" checked>否
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-xs-4 control-label">同意公开：</label>
                                <div class="col-xs-8">
                                    <label class="check-box">
                                        <input name="openX" id="openX1" value="1" type="radio">是
                                    </label>
                                    <label class="check-box">
                                        <input name="openX" id="openX0" value="0" type="radio" checked>否
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-xs-4 control-label">重复来电：</label>
                                <div class="col-xs-8">
                                    <label class="check-box">
                                        <input name="repeatFlag" id="repeatFlag1" value="1" type="radio">是
                                    </label>
                                    <label class="check-box">
                                        <input name="repeatFlag" id="repeatFlag0" value="0" type="radio" checked>否
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-xs-4 control-label">紧急联系：</label>
                                <div class="col-xs-8">
                                    <label class="check-box">
                                        <input name="mark" value="1" type="radio">是
                                    </label>
                                    <label class="check-box">
                                        <input name="mark" value="0" type="radio" checked>否
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-sm-4 control-label ">影响范围：</label>
                                <div class="col-sm-8">
                                    <input name="affectScope" placeholder="请输入" class="form-control" type="text"
                                           id="incidence">
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-sm-4 control-label ">提取码：</label>
                                <div class="col-sm-8">
                                    <input name="wsKey" class="form-control" type="text" id="wsKey" readonly
                                           UNSELECTABLE="on"><span>(自动生成)</span>
                                </div>
                            </div>
                        </div>
                        <!--                <div class="col-sm-12">-->
                        <!--                    <div class="form-group">-->
                        <!--                        <label class="col-xs-4 control-label">紧急联系：</label>-->
                        <!--                        <div class="col-xs-8">-->
                        <!--                            <label class="check-box">-->
                        <!--                                <input name="mark" value="1" type="radio">是-->
                        <!--                            </label>-->
                        <!--                            <label class="check-box">-->
                        <!--                                <input name="mark" value="0" type="radio" checked>否-->
                        <!--                            </label>-->
                        <!--                        </div>-->
                        <!--                    </div>-->
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-xs-4 control-label">坐席备注：</label>
                                <div class="col-xs-8">
                                    <select id="xSysDescSelect" onchange="dropChgSendTextOnly(this,'xsysDesc');"
                                            th:with="district=${@commonServiceImpl.findSeatsRemark()}"
                                            class="form-control formSelect">
                                        <option value="">--请选择--</option>
                                        <option th:each="item : ${district}" th:text="${item['CSText']}"
                                                th:value="${item['CSValue']}"></option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <!--                                <label class="col-xs-4 control-label">备注内容：</label>-->
                                <div class="col-xs-12">
                                    <textarea name="xsysDesc" id="xsysDesc" maxlength="3500" style="resize: vertical;"
                                              class="form-control SeatsRemark" rows="5"></textarea>
                                    <span>还可以输入<i class="SeatsRemarkI">3500</i>个文字</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-12 entering-bt">
                        <div style="margin: 0 auto;padding-bottom: 20px">
                            <button type="button" class="btn btn-sm btn-warning" onclick="draft('存草稿','101')">存草稿
                            </button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <button type="button" class="btn btn-sm btn-primary" onclick="draft('转值班长处理','120')">
                                转值班长
                            </button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <button type="button" class="btn btn-sm btn-info" onclick="draft('坐席当场解答','131')">当场解答
                            </button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <button type="button" class="btn btn-sm btn-success"
                                    onclick="draft('无效来电 当场作废','132')">
                                无效来电
                            </button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input id="tbStateDesc" name="stateDesc" value="草稿" type="hidden"/>
                            <input id="stateFlag" name="stateFlag" value="101" type="hidden"/>
                            <button type="button" class="btn btn-sm btn-warning" onclick="$.modal.closeTab()">关闭
                            </button>&nbsp;
                        </div>
                    </div>
                </div>
            </div>

            <!--     右       -->
            <div class="col-sm-5 entering-page">
                <div class="col-sm-12">
                    <ul class="nav nav-pills nav-tabs" style="margin: 10px 0 10px 0;" id="navUL">
                        <!--                        历史来电-->
                        <li role="presentation"><a href="javascript:void(0);" target="myIframe" id="telHistoryByAddress">地址画像</a></li>
                        <li role="presentation" style="margin: 0 0 0 -5px"><a href="javascript:void(0);" target="myIframe" id="telHistory">同号工单来电</a></li>
                        <!--                        同号工单来电-->
<!--                        <li role="presentation" style="margin: 0 0 0 -5px"><a href="javascript:void(0);" target="myIframe" id="phoneWork">同号工单来电</a></li>-->
                        <!--                        类案推荐-->
                        <li role="presentation" class="recommendli" style="margin: 0 0 0 -5px"><a href="javascript:void(0);" target="myIframe" id="recommend">类案推荐</a>
                        </li>
                        <li role="presentation"><a href="javascript:void(0);" target="myIframe" id="relevance">关联推荐</a>
                        </li>
                    </ul>
                    <iframe style="width: 100%;height: 600px;border: medium none" name="myIframe"
                            id="myIframe"></iframe>
                </div>
            </div>
        </div>
    </form>


</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-typeahead-js" />
<script th:src="@{/ajax/libs/bootstrap-tagsinput/tagsinput.min.js}"></script>
<script th:src="@{/ajax/libs/jQuery-ui/jquery-ui.js}"></script>
<script th:src="@{/ajax/libs/qxEasyUI/jquery.easyui.min.js}"></script>
<script th:src="@{/js/sensitivity.js}"></script>
<script th:src="@{/js/teladd.js}"></script>
<script th:src="@{/js/baiduApi.js?a=110}"></script>
<script>
    // function aboutContent(){
    //     var content = $('.phoneRemark').val();
    //     if (content.length > 0) {
    //         scopeOfImpact(content);
    //         getHotWord(content);
    //         contentTypeRecommend(content);
    //     }
    //     return false;
    // }

    //影响范围
    function scopeOfImpact(content){
        let beginIndex = content.indexOf("影响范围:")
        if (beginIndex > 0){
            let intercept = content.substring(beginIndex, content.length)
            let endIndex;
            if (intercept.indexOf("\n")>0){
                endIndex = beginIndex + intercept.indexOf("\n")
            }else{
                endIndex = content.length
            }
            //影响范围
            let affectScope = content.substring(beginIndex + 5, endIndex)
            $('#incidence').val(affectScope)
        }else{
            return false;
        }
    }

    //被诉主体画像
    function _accSubjectDraw() {
        var accSubject = $('#subject').val();
        if (accSubject.length <= 0) {
            $.modal.msgWarning("请输入被诉主体");
            $('#subject').blur()
            return false
        } else {
            var options = {
                width: '34%',
                height: '83%',
                title: '被诉主体画像',
                url: ctx + "system/mTelRcd/accSubjectDraw?accSubject=" + accSubject,
                btn: 0,
                shadeClose: false
            };
        }
        $.modal.openOptions(options);
    }

    // 选择内容分类
    $('#qxCT').combotree({
        url: '/system/common/findContentCate',
        required: false,
        onSelect: function (record) {
            $("#txtDcntAcode").val(record.id);
            $("#txtDCntAName").val(record.text);
            $('.combo-text').removeClass('error');
        }
    });

    var prefix = ctx + "system/mTelRcd";
    $(document).ready(function () {
        // 新增电话记录，设置诉求默认值
        $('#dfmClaNo').val('40');
        $('#dfmClaName').val('投诉举报');
        // $("#tmFrom").val(DateToStr());
        // $('#telHistory').click();
        // checkError();
    })
    var sensitiveInfo = new Object();

    function GetChildValue(data) {
        sensitiveInfo.cardId = data[0].value;
        sensitiveInfo.militaryId = data[1].value;
        sensitiveInfo.realName = data[2].value;
        sensitiveInfo.medicalCardNum = data[3].value;
        sensitiveInfo.other = data[4].value;
        console.log(sensitiveInfo);
    }

    //    存草稿
    function draft(fpStr, str) {
        $("#tbStateDesc").val(fpStr);
        $('#stateFlag').val(str);
        if (str == '132') {
            $("#fmAreaNo").val(909909);
            $("#fmAreaNo").find("option[value=909909]").attr("selected", true);
            $('#fmContent').val('无效来电');
            $('#dfmClaNo').val('99');
            $("#dfmClaNo").find("option[value=99]").attr("selected", true);
            $("#txtDcntAcode").val(11490401);
            $("#txtDCntAName").val('无效来电');
            $("#txtDcntAcode").find("option[value=11490401]").attr("selected", "selected");
            $('#xsysDesc').val('已当场处理');
        }
        var flag = $.validate.form();
        if ($("#txtDcntAcode").val() == '') {
            $('.combo-text').addClass('error');
            flag = false;
        } else {
            $('.combo-text').removeClass('error');
        }
        if (flag) {
            if (!$.isEmptyObject(site)) {
                $('#fmAreaName').val(site.district);
            }
            let data = $('#form-user-add').serializeArray();
            if (!$.isEmptyObject(site)) {
                data.push({name: "uid", value: site.uid});
                data.push({name: "name", value: site.name});
                data.push({name: "address", value: site.address});
                data.push({name: "alias", value: site.alias});
                data.push({name: "tag", value: site.tag});
                data.push({name: "province", value: site.province});
                data.push({name: "city", value: site.city});
                data.push({name: "district", value: site.district});
                data.push({name: "telephone", value: site.telephone});
                data.push({name: "locationx", value: site.location.x});
                data.push({name: "locationy", value: site.location.y});
                data.push({name: "distance", value: site.distance});
                data.push({name: "brandName", value: site.brandName});
                data.push({name: "aoiName", value: site.aoiName});
                data.push({name: "storeComment", value: site.storeComment});
                data.push({name: "storePeriod", value: site.storePeriod});
                data.push({name: "faceId", value: site.faceId});
                data.push({name: "bid", value: site.bid});
            }
            if (!$.isEmptyObject(sensitiveInfo)) {
                data.push({name: "cardId", value: sensitiveInfo.cardId});
                data.push({name: "militaryId", value: sensitiveInfo.militaryId});
                data.push({name: "realName", value: sensitiveInfo.realName});
                data.push({name: "medicalCardNum", value: sensitiveInfo.medicalCardNum});
                data.push({name: "other", value: sensitiveInfo.other});
            }
            $.operate.saveTab(prefix + "/save", data);
        }
    }

    var sensitiveInfo = new Object()

    function setSensitiveId(id) {
        // sensitiveInfo.cardId = data[0].value;
        // sensitiveInfo.militaryId = data[1].value;
        // sensitiveInfo.realName = data[2].value;
        // sensitiveInfo.medicalCardNum = data[3].value;
        // sensitiveInfo.other = data[4].value;
        $('#sensitiveId').val(id);
    }

    $('#fromSex1,#fromSex0').on('ifClicked', function (obj) {
        if (this.value == 1) {
            $('#fromName').val('先生');
        } else if (this.value == 0) {
            $('#fromName').val('女士');
        }
    })

    function doSubmit(index, layero) {
        var body = layer.getChildFrame('body', index);
        $("#treeId").val(body.find('#treeId').val());
        $("#treeName").val(body.find('#treeName').val());
        layer.close(index);
    }

    function copy(type, dataList) { //0为历史工单 ,1为同号工单
        var data;
        var str1;
        var str2;
        if (type == 0) {
            data = dataList;
            str1 = '情况：来话人来电反映';
            str2 = '的相同问题';
        } else {
            data = dataList.telGetDeal;
            str1 = '来话人反映';
            str2 = '相同问题';
        }
        $('#subject').val(data.accSubject);
        $('#fmAddress').val(data.fmAddress);
        $('#fromName').val(data.fromName);
        if (data.wkPkId != -1) {
            let content = data.fmContent;
            if (content.indexOf(str1) == -1) {
                console.log(data.wkFmNo)
                $('#fmContent').val(str1 + data.wkFmNo + str2 + content);
            } else {
                content = content.substr(28);
                $('#fmContent').val(str1 + data.wkFmNo + str2 + content);
            }
        } else {
            $('#fmContent').val(data.fmContent);
        }
        $('#keyWord').val(data.keyWord);
        $('#hideTel5').checked = data.hideTel == 5 ? true : $('#hideTel0').checked = false;
        $('#repeatFlag1').checked = data.repeatFlag == 1 ? true : $('#repeatFlag0').checked = false;
        $('#openX1').checked = data.openX == 1 ? true : $('#openX0').checked = false;
        $('#fromSex1').checked = data.fromSex == '1' ? true : $('#fromSex0').checked = false;
        $('#incidence').val(data.affectScope);
        var areas = $('#fmAreaNo').find('option');
        for (var i = 0; i < areas.length; i++) {
            if (areas[i].value == data.fmAreaNo) {
                areas[i].selected = true;
                break;
            }
        }
        $('#fmAreaName').val(data.fmAreaName);
        var dfms = $('#dfmClaNo').find('option');
        for (var i = 0; i < dfms.length; i++) {
            if (dfms[i].value == data.dfmClaNo) {
                dfms[i].selected = true;
                break;
            }
        }
        $('#dFmClaName').val(data.dfmClaName);
        $('#qxCT').combobox('setText', data.dcntAname);
        $('#txtDcntAcode').val(data.dcntAcode);
        $('#txtDCntAName').val(data.dcntAname);
        $('#xsysDesc').val(data.xsysDesc);
        $('#xdealDesc').val(data.xdealDesc);
    }

    function telDetail(wfid, tid) {
        var url = '';
        var title = '';
        // var width = '85%';
        // var height = '80%';
        if (wfid == -1) {
            url = ctx + 'system/lookup/telGetDetail/' + tid;
            title = '通话记录详情';
        } else if (wfid == 1) {
            url = '/system/lookup/telOrderDetail/' + tid;
            title = '同号工单详情';
        } else {
            url = ctx + 'system/test/caseDetail/' + wfid;
            title = '通话工单详情';
        }
        $.modal.openTab(title, url);
    }

    function aiAnswering() {
        let url = '/system/bdapi/intelligent/ai';
        let title = '智能问答';
        let width = '50%';
        let height = '90%';
        $.modal.openDialog(title, url, width, height);
    }
</script>
</body>
</html>